package com.hong.chapter2;

/**
 * Created by hong on 2018/5/28.
 * 策咯模式
 */
public class TaxCalculatorMain {

    public static void main(String[] args) {
       /* final TaxCalaculator calaculator = new TaxCalaculator(10000d,2000d){
            @Override
            public double calcTax(){
                return getSalary()*0.1+getBonus()*0.15;//
            }
        };
        double tax = calaculator.calcTax();
        System.out.println(tax);*/

        TaxCalaculator calaculator = new TaxCalaculator(10000d,2000d,(s,b)->s*0.1+b*0.15);

        System.out.println(calaculator.calcuate());

    }
}
